package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.components.Firewall;

public class FirewallMapper implements RowMapper<Firewall> {

	@Override
	public Firewall mapRow(final ResultSet result, final int row) throws SQLException {
	    Firewall firewall = new Firewall(result.getString("name"), 
	                                     result.getInt("energyTurnOn"),
	                                     result.getInt("difficultAccess"),
	                                     result.getInt("prize"));	
	    
	    firewall.setIdComponent(result.getInt("idComponent"));
		return firewall;
	}

}
